<#include "/common/layout.html">
<@header>
</@header>
<@body>
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h1>
      <small>系统管理 > 用户管理</small>
    </h1>
  </section>
  <!-- Main content -->
  <section class="content">
     <div class="row">
      <div class="col-md-12">
        <!-- general form elements -->
        <div class="box box-primary">
          <div class="box-header with-border">
            <h3 class="box-title">编辑用户</h3>
          </div><!-- /.box-header -->
          <!-- form start -->
          <div class="row">
          	<div class="col-md-6">
        	  <form role="form" data-validator-option="{theme:'bootstrap', timely:2, stopOnError:true}" method="post" action="/system/user/doEdit">
	            <div class="box-body">
	              <div class="form-group">
	                <label for="uname">用户名</label>
	                <input type="hidden" value="${sysUser.id}" name="id">
	               	<input type="text" id="uname" name="userName" value="${(sysUser.userName)!}" class="form-control" placeholder="请输入用户名"  data-rule="用户名:required;username;">
	              </div>
	              <div class="form-group">
                     <label>部门</label>
                     <select name="deptId" class="form-control select2" style="width: 100%;" data-rule="部门:required;">
                      <#list deptList as dept>
                        <option value="${(dept.id)!}" <#if sysUser.deptId?? && dept.id==sysUser.deptId> selected="selected" </#if> >${(dept.deptName)!}</option>
                      </#list>
                    </select>
                  </div>
	              <div class="form-group">
	                <label for="password">密码</label>
	                <input type="password" class="form-control" disabled="disabled" id="password" value="********" name="password" placeholder="请输入密码" data-rule="密码: required; length(6~16)">
	              </div>
	              <div class="form-group">
                      <label>描述</label>
                      <textarea class="form-control" name="userDesc" rows="3" placeholder="请输入描述，最多300个字符 ..." >${(sysUser.userDesc)!}</textarea>
                    </div>
	              <div class="form-group">
                    <label>
                      <input name="userState" type="radio" class="minimal" <#if sysUser.userState = 1> checked </#if> value="1"> 启用
                    </label>
                    <label>
                      <input name="userState" type="radio" class="minimal" <#if sysUser.userState = -1>checked </#if>  value="-1"> 禁用
                    </label>
                  </div>
                  <div class="form-group">
                  	<#list sysRoles as role>
	                    <label title="${(role.roleDesc)!}">
	                      <input type="checkbox" name="roleId" class="minimal" value="${(role.id)!}" <#if myRolds?seq_contains('${role.id}') > checked </#if> >
	                      ${(role.roleName)!}
	                    </label>
	                    &nbsp;
                    </#list>
                  </div>
	            </div><!-- /.box-body -->
	            <div class="box-footer">
	              <button type="submit" class="btn btn-success"><i class="fa fa-save"></i>  提 交</button>
	              <a  class="btn btn-default" href="/system/user/list/1.html"><i class="fa fa-close"></i>  取消</a>
	            </div>
	          </form>
          	</div>
          </div>
        </div><!-- /.box -->
      </div><!--/.col (left) -->
     </div>
  </section><!-- /.content -->
</div><!-- /.content-wrapper -->
</@body>
<@footer>
</@footer>